﻿@{
    ViewBag.Title = "chang";
    Layout = "~/Views/Shared/ShouYe.cshtml";
}
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/Scripts/js/jquery.min.js"></script>
<script src="~/Scripts/js/bootstrap.min.js"></script>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<h2>用户显示</h2>
<input onclick="chaxun()" type="button" value="用户名查询" style="float:right;padding-right:10px;margin-top:8px;width:100px;height:30px;" />
<input type="text" id="username" style="float:right;margin-right:5px;margin-left:10px;margin-top:14px;border-width:1px;border-color:black" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" />
<table class="tab-content table table-bordered table-striped table-responsive">
    <thead>
        <tr>
            <th style="text-align:center">编号</th>
            <th style="text-align:center">用户名</th>
            <th style="text-align:center">真实姓名</th>
            <th style="text-align:center">职位</th>
            <th style="text-align:center">操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var i in ViewBag.userShow)
        {
            <tr>
                <td>@i.userID</td>
                <td>@i.userName</td>
                <td>@i.userRealname</td>
                @foreach (var q in ViewBag.list)
                {
                    if (@q.RoleId == @i.RoleId)
                    {
                        <td>@q.RoleName</td>
                    }
                    else
                    {
                        continue;
                    }
                }
                <td><a href="/people/xiu?userid=@i.userID">修改</a></td>
            </tr>
        }
    </tbody>
</table>
<script>
    function chaxun() {
        var name = $("#username").val();
        location.href = "/people/chang?userName=" + name;
    }
    function tianjia() {
        location.href = "/Home/zhuce";
    }
</script>